package com.ruoyi.hotel.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hotel.domain.LyhmsCustomer;
import com.ruoyi.hotel.mapper.LyhmsCustomerMapper;
import com.ruoyi.hotel.service.ILyhmsCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-28
 */
@Service
public class LyhmsCustomerServiceImpl implements ILyhmsCustomerService
{
    @Autowired
    private LyhmsCustomerMapper lyhmsCustomerMapper;

    /**
     * 查询
     * 
     * @param id 主键
     * @return
     */
    @Override
    public LyhmsCustomer selectLyhmsCustomerById(Long id)
    {
        return lyhmsCustomerMapper.selectLyhmsCustomerById(id);
    }

    /**
     * 查询列表
     * 
     * @param lyhmsCustomer
     * @return
     */
    @Override
    public List<LyhmsCustomer> selectLyhmsCustomerList(LyhmsCustomer lyhmsCustomer)
    {
        return lyhmsCustomerMapper.selectLyhmsCustomerList(lyhmsCustomer);
    }

    /**
     * 新增
     * 
     * @param lyhmsCustomer
     * @return 结果
     */
    @Override
    public int insertLyhmsCustomer(LyhmsCustomer lyhmsCustomer)
    {
        lyhmsCustomer.setCreateTime(DateUtils.getNowDate());
        return lyhmsCustomerMapper.insertLyhmsCustomer(lyhmsCustomer);
    }

    /**
     * 修改
     * 
     * @param lyhmsCustomer
     * @return 结果
     */
    @Override
    public int updateLyhmsCustomer(LyhmsCustomer lyhmsCustomer)
    {
        return lyhmsCustomerMapper.updateLyhmsCustomer(lyhmsCustomer);
    }

    /**
     * 批量删除
     * 
     * @param ids 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteLyhmsCustomerByIds(Long[] ids)
    {
        return lyhmsCustomerMapper.deleteLyhmsCustomerByIds(ids);
    }

    /**
     * 删除信息
     * 
     * @param id 主键
     * @return 结果
     */
    @Override
    public int deleteLyhmsCustomerById(Long id)
    {
        return lyhmsCustomerMapper.deleteLyhmsCustomerById(id);
    }
}
